export default {
    namespaced:true,
    state:()=>({
        addressList:[
            {
                username:'张三丰',
                phone:'13966668888',
                tel:['023','55556666'],
                loc:[
                    {name:'河北',idx:2},
                    {name:'唐山',idx:1},
                    {name:'路南区',idx:0},
                ],
                address:'大西洋国际',
                isDefault:true
            },
            {
                username:'张无忌',
                phone:'13966668888',
                tel:['023','55556666'],
                loc:[
                    {name:'山西',idx:3},
                    {name:'大同',idx:1},
                    {name:'矿区',idx:1},
                ],
                address:'1号井',
                isDefault:false
            }
        ]
    }),
    mutations:{
        addAddressMut(state,{obj,editNum}){ //新增地址、编辑地址
            if(editNum==-1){
                state.addressList.push(obj) //新增
            }else{
                state.addressList[editNum] = obj //编辑
            }
        }
    }
}